package com.atues.kuangshengjuc.unsafe;

import java.util.HashSet;
import java.util.Set;
import java.util.UUID;

public class SetTest {
    public static void main(String[] args) {
        //创建一个HashSet
        Set<String> set = new HashSet<>();
        for(int i = 0 ; i < 1000 ; i++){
            new Thread(() -> {
                //添加元素
                set.add(UUID.randomUUID().toString());
                System.out.println(set);
            }, "线程" + i).start();
        }
        //添加元素

//        System.out.println(set);
    }
}
